package com.hko.qrip.dao.impl;

import java.sql.SQLException;

import org.springframework.beans.factory.annotation.Autowired;

import com.hko.qrip.bean.PilotReport;
import com.hko.qrip.dao.PilotReportDao;
import com.ibatis.sqlmap.client.SqlMapClient;

public class PilotReportDaoImpl implements PilotReportDao {
	@Autowired
	private SqlMapClient sqlMapClient;

	@Override
	public String testConnection() throws SQLException {
		String str = (String) sqlMapClient.queryForObject("connectionTest");
		return str;
	}

	@Override
	public PilotReport getPilotReportById(int id) throws SQLException {
		PilotReport pr = (PilotReport) sqlMapClient.queryForObject("getPilotReportById", id);
		return pr;
	}

	@Override
	public int insertPilotReport(PilotReport pr) throws SQLException {
		return sqlMapClient.update("insertPilotReport");
		
	}

}
